package dk.isten.andro.julesangbog;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.TextView;

public class Evangelium_Act extends Activity implements OnClickListener{
	
	TextView textview1;
	Button youtubejuleevangeliumbutton;

	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.evangelium);
        setTitle("Juleevangeliet");
        
        WebView webView = (WebView) findViewById(R.id.webView1);

		webView.loadUrl("file:///android_asset/juleevangeliet.html");
		webView.getSettings().setBuiltInZoomControls(true);
		
		youtubejuleevangeliumbutton = (Button) findViewById(R.id.youtubejuleevangeliumbutton);
		
		youtubejuleevangeliumbutton.setOnClickListener(this);
		
   
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_front_act, menu);
        return true;
    }
    
	  // Called every time user clicks on a menu item
	  @Override
	  public boolean onOptionsItemSelected(MenuItem item)
	  { 
		  switch (item.getItemId()) 
		  {
		  		case R.id.support:
		  			startActivity(new Intent(this, SupportActivity.class));
		  			break;
		  }  
		  
		  return true;
	  }
	  
    @Override
	public void onClick(View v) {
		if(v==youtubejuleevangeliumbutton){ 
				
				Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube:knlS_wMV-rc"));
//				 i.setPackage("com.google.android.youtube");
				 i.putExtra("VIDEO_ID", "knlS_wMV-rc");
//				 i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
				 startActivity(i);
			}
		
	}
}
